function Particula(x,y,type,timeLife){
	this.x = x;
	this.y = y;
	this.w = 1;
	this.h = 1;
	this.vx = Math.random() * 6 - 3;
	this.vy = Math.random() * 6;
	this.type = type;
	this.timeLife = timeLife + 10  ;
	this.life = 0;
}

Particula.prototype = {
	moveParticles : function(){
		this.x += this.vx;
		this.y += this.vy;
		
		this.life +=1;
		
		if(this.life == this.timeLife){
			deleteParticle(this);
		}
	},
}

function deleteParticle(particula){
	particulas.splice(particulas.indexOf(particula),1);	
}

function randomColor(){
	var	rnd = Math.floor(Math.random() *4);
	switch(rnd){
		
		case 0:
			return img_white_particle;
		break;
		case 1:
			return img_red_particle;
		break;
		case 2:
			return img_yellow_particle;
		break;
		case 3:
			return img_green_particle;
		break;
	}
	
	return img_white_particle;
}
